package kr.co.softtrain.glc;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class ProfileActivity extends BaseActivity implements OnClickListener {

	private ImageView imgProfileThumb = null;
	private TextView txtId = null;
	private TextView txtPencilCnt = null;

	private String userId = null;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.profile);
		init();
	}

	private void init() {

		userId = "wsky1101@gmail.com";

		// �׺���̼� ��
		initNavigationBar(R.id.mainLayout);
		setNaviTitle(userId);

		setData();
		setLink();
	}

	private void setData() {
		imgProfileThumb = (ImageView) findViewById(R.id.imgProfileThumb);
		txtId = (TextView) findViewById(R.id.txtId);

		txtPencilCnt = (TextView) findViewById(R.id.txtPencilCnt);

		imgProfileThumb.setImageResource(R.drawable.ic_launcher);
		txtId.setText(userId);
		txtPencilCnt.setText("5");
	}

	private void setLink() {
		imgProfileThumb.setOnClickListener(this);
		findViewById(R.id.imgPencil).setOnClickListener(this);
		txtPencilCnt.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {

		switch (v.getId()) {
			case R.id.imgProfileThumb:
				Intent photoIntent = new Intent(ProfileActivity.this, ChangePhotoPopupActivity.class);
				startActivity(photoIntent);
				break;
				
			case R.id.imgPencil:
			case R.id.txtPencilCnt:
				Intent pencilIntent = new Intent(ProfileActivity.this, PencilPointActivity.class);
				startActivity(pencilIntent);
				break;
		}
	}

}
